import 'dart:io';

import 'package:scanner/common/wj_common_enum.dart';


class WJStatic {
  /// 打包上架前切记调整为正服
  static const bool isDebugMode = false; //是否是测服

  static const String requestEncrypt = "requestEncrypt"; //请求是否加密标记

  static const int pageSize = 10; //分页加载数据条数

  static String dnAppId = ""; //动能sdk appid

  static String projectId = ""; //项目id 每次打包+1

  static Map<String, dynamic> dnLoginAppInfo = {}; //动能登录信息

  ///协议相关
  static const String protocolUserAndroid = ''; //安卓用户协议
  static const String protocolPrivacyAndroid = ''; //安卓隐私协议
  static const String protocolVipAndroid = ''; //安卓会员服务协议
  static const String protocolVipSubscriptionAndroid = ''; //安卓会员自动续订协议

  static const String protocolUserIos =
      'https://h.ningminkj.com/appPro/keyboardAppletUserAgreement.html?n=%E8%9C%9C%E5%AE%9D%E9%94%AE%E7%9B%98&t=41'; //Ios用户协议
  static const String protocolPrivacyIos =
      'https://h.ningminkj.com/appPro/keyboardAppletPartyclearPrivate.html?n=%E8%9C%9C%E5%AE%9D%E9%94%AE%E7%9B%98&t=41'; //Ios隐私协议
  static const String protocolVipIos =
      'https://h.ningminkj.com/appPro/keyboardMemberAgreement.html?n=%E8%9C%9C%E5%AE%9D%E9%94%AE%E7%9B%98&t=41'; //Ios会员订阅协议
  static const String protocolVipSubscription =
      'https://h.ningminkj.com/appPro/keyboardAutoServiceAgreement.html?n=%E8%9C%9C%E5%AE%9D%E9%94%AE%E7%9B%98&t=41'; //ios会员续费协议


  static Future<String> getProtocolUrl(WJUrlEnum arProtocolEnum) async {
    String cnTermsUrl = '';

    switch (arProtocolEnum) {
      case WJUrlEnum.user:
        cnTermsUrl = Platform.isAndroid ? protocolUserAndroid : protocolUserIos;
      case WJUrlEnum.privacy:
        cnTermsUrl = Platform.isAndroid ? protocolPrivacyAndroid : protocolPrivacyIos;
      case WJUrlEnum.androidVip:
        cnTermsUrl = protocolVipAndroid;
      case WJUrlEnum.androidSub:
        cnTermsUrl = protocolVipSubscriptionAndroid;
      case WJUrlEnum.iosVip:
        cnTermsUrl = protocolVipIos;
      case WJUrlEnum.iosSub:
        cnTermsUrl = protocolVipSubscription;
    }

    Platform.isIOS ? protocolUserIos : protocolUserAndroid;

    return cnTermsUrl;
  }

  static String getDecryptKey() {
    if (isDebugMode) {
      return 'dnwx1234567890bk';
    } else {
      return 'keyboardK5Bush9E';
    }
  }
}
